const mongoose = require("mongoose");
const { MONGODB } = require("../config/config.default");

(function connect() {
  mongoose
    .connect(MONGODB.URI)
    .then(() => {
      console.log("MongoDB connected successfully");
    })
    .catch((err) => {
      console.error("MongoDB connection error:", err);
    });
})();

module.exports = {
  User: mongoose.model("User", require("./userModel")),
  Img: mongoose.model("Img", require("./imgModel")),
  Subscribe: mongoose.model("Subscribe", require("./subscribeModel")),
};
